{% extends '@SyliusAdmin/layout.html.twig' %}

{% import 'SyliusUiBundle:Macro:headers.html.twig' as headers %}

{% set header = 'sylius.ui.generate_variants' %}

{% block title %}{{ parent() }} {{ header|trans }}{% endblock %}

{% form_theme form 'SyliusUiBundle:Form:theme.html.twig' %}

{% block content %}
{{ sonata_block_render_event('sylius.admin.product_variant.generate.before_header', {'resource': resource}) }}

{{ headers.default(product.name, 'random', configuration.vars.subheader|default(header)|trans) }}

{{ sonata_block_render_event('sylius.admin.product_variant.generate.after_header', {'resource': resource}) }}

{% include '@SyliusAdmin/ProductVariant/Generate/_breadcrumb.html.twig' %}

{{ sonata_block_render_event('sylius.admin.product_variant.generate.after_breadcrumb', {'resource': resource}) }}

{{ form_start(form, {'action': path('sylius_admin_product_variant_generate', {'productId': product.id}), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate'}}) }}
<div class="ui segment">
    {% include '@SyliusAdmin/ProductVariant/Generate/_form.html.twig' %}
    <div class="ui basic segment">
        <div class="ui buttons">
            <button class="ui labeled icon primary button" type="submit"><i class="random icon"></i>{{- 'sylius.ui.generate'|trans -}}</button>
            <div class="or" data-text="{{ 'sylius.ui.or'|trans }}"></div>
            {% include '@SyliusUi/Form/Buttons/_cancel.html.twig' with {'path': path(configuration.getRouteName('index'), {'productId': product.id})} %}
        </div>
    </div>

    {{ sonata_block_render_event('sylius.admin.product_variant.generate.form', {'resource': resource}) }}
</div>
{{ form_row(form._token) }}
{{ form_end(form, {'render_rest': false}) }}

{{ sonata_block_render_event('sylius.admin.product_variant.generate.after_content', {'resource': resource}) }}
{% endblock %}
